﻿<html >
<head>
    <title>Webtop application</title>
    <script type="text/javascript" src="../../dhtiny.js"></script>
    <script type="text/javascript" src="../../util/event.js"></script>
    <script type="text/javascript" src="../../util/animation.js"></script>        
    <script type="text/javascript" src="../../util/dragmanager.js"></script>
    <script type="text/javascript" src="../../util/imgList.js"></script>    
    <script type="text/javascript" src="../../ctrl/richCanvas.js"></script>
    <script type="text/javascript" src="../../ctrl/animItem.js"></script>        
    <script type="text/javascript" src="../../util/dragmanager.js"></script>
    <script type="text/javascript" src="../../util/animation.js"></script>
    <script type="text/javascript" src="../../ctrl/dialog.js"></script>
    <script type="text/javascript" src="../../ctrl/treeview.js"></script>    
    <script type="text/javascript" src="icon.js"></script>
    <script type="text/javascript" src="taskbar.js"></script>
    <link rel="stylesheet" type="text/css" href="css/main.css" />
</head>
<body> <!-- *background="webtop/images/backgroundcorner.gif"-->
<script type="text/javascript">
$dh.addLoader(function() {
    var taskbar = $dh.$new("div",{opac:100});    
    $dh.construct(taskbar, Taskbar,[27]);
    $dh.addCh(document.body, taskbar);/**/
    $dh.construct(document.body,GridManager,[]);
    
    $dh.disableSelect(document.body);
    
    //$dh.construct(document.body,DHFormManager,[]);
    
    document.body.moveGridTo(10,30);
    for (var k = 0 ; k < 16 ; k ++ ) {
        var icon = $dh.$new(GridIcon, [document.body, (k%2==0)? "Ghost drag": "Normal drag",k%5])
        icon.ondblclick = function() {
            if (!$dh.isNone(this.targetForm)) {
                this.targetForm.show();
                return;
            }
            var bs = $dh.bodySize();
            // Dialog size: dw = width, dh = height
            var dw = 400, dh = 320;
            var form = new DHDialog(document.body, {
                id : "MyDialog",
                titleTxt: "タイトル",
                bottomTxt: "Statusテキスト",
                top: Math.floor(bs.height / 2), left: Math.floor(bs.width / 2), 
                width: 20, 
                height: 14,
                color: "yellow",
                titlebarHeight: 35,
                zIndex: 999999,
                imgPath: $dh.lib.path + "res/images/dialog/theme3/"
            });
            
            $dh.addEv(form.canvas, "mousedown", function(ev) {
                if (window.currentDHForm)
                    window.currentDHForm.canvas.style.zIndex = 0;
                window.currentDHForm = form;
                form.canvas.style.zIndex = 999;
            });
            
            form.bodypart.setProp("background", "#0089ab");
            form.title.style.cssText += ";text-align:center;font-weight:bold;border-bottom:solid 1px #aaaaaa"; // For FF
            form.title2.canvas.style.borderBottom = "solid 1px #aaaaaa"; // For IE
            form.title.style.cursor = "default";

            var iframe = document.createElement("iframe");
            iframe.style.cssText += "border:none;width:100%;height:100%;position:absolute;top:0px;left:0px;"; //";border:none;left:" + form.cornerWidth + "px;height:" + (dh - form.titlebarHeight - form.bottombarHeight - 20) + "px;position:absolute;top:15px;width:" + (dw - 2 * form.cornerWidth) + "px;";
            iframe.frameBorder = "0";
            iframe.src = "http://google.co.jp";

            form.addEv("onanimstart", function() {
                form.body.canvas.style.display = "none";
            });
            form.addEv("onanimstop", function() {
                form.body.canvas.style.display = "";
                form.body.canvas.appendChild(iframe);
            });

            var bs = $dh.bodySize();
            form.show();
            form.draw({ top: Math.floor(bs.height / 2), left: Math.floor(bs.width / 2), width: 5, height: 5 });
            form.draw({ top: Math.floor(bs.height / 2) - 195, left: 550, width: dw, height: dh }, 1);     
            /*/ TreeView Demo
            var tree = $dh.$new(DHTreeView,[18]);
            $dh.addCh(form.body, tree);            
            tree.expandNode(null,data1);*/
        }
    }     
    window.data1 = [["Folder-A",0],["File-B",1],["File-C",1],["File 1",1],["Folder-AB",0]];
});

</script>
</body>
</html>